var webpack = require ('webpack');
var values = require ('postcss-modules-values'); //css 变量
module.exports = {
  entry: __dirname + '/index.js',
  output: {
    publicPath: '/',
    filename: './bundle.js',
  },
  module: {
    loaders: [
      {
        test: /\.jsx?$/,
        exclude: /node_modules/,
        loader: 'babel',
        query: {
          presets: ['es2015', 'stage-0', 'react'],
        },
      },
      {
        test: /\.css$/,
        loader: 'style-loader!css-loader?modules&localIdentName=[path][name]-[local]-[hash:base64:5]',
      },
    ],
  },
  postcss: [values],
  plugins: [
    new webpack.optimize.UglifyJsPlugin ({
      compress: {warnings: false},
    }),
  ],
};
